﻿@model List<VietPublisher.BSL.BK.T_BK_Category>
<script type="text/javascript" charset="utf-8">
    var oTable;
    $(document).ready(function () {
        $('#example').dataTable({
            "sScrollY": "200px",
            "bPaginate": true
            // "bSort": false
            //"bFilter": false //search textbox is disable

        });



        /* Add a click handler to the rows - this could be used as a callback */
        $("#example tbody tr").click(function (e) {
            //alert(oTable);
            if ($(this).hasClass('row_selected')) {
                $(this).removeClass('row_selected');
            }
            else {
                oTable.$('tr.row_selected').removeClass('row_selected');

                $(this).addClass('row_selected');
            }
        });


        /* Init the table */
        oTable = $('#example').dataTable();
    });
</script>
<table id="example" class="display" width="100%">
    <thead>
        <tr class="">
            <th>
                Number ID
            </th>
            <th>
                Category Name
            </th>
            <th>
                Level
            </th>
            <th>
                Position
            </th>
            <th>
                Sub CategoryID
            </th>
            <th>
                Controller
            </th>
            <th>
                Action
            </th>
            <th>
                Is Admin
            </th>
            <th>
                Is Use
            </th>
        </tr>
    </thead>
    <tbody>
        @{
            int i = 0;
        }
        @foreach (var category in Model)
        {
            i++;
            <tr>
                <td>
                    @i
                    <input type="hidden" value="@category.CategoryID" />
                </td>
                <td>@category.CategoryName
                </td>
                <td>@category.CategoryLevel
                </td>
                <td>@category.Position
                </td>
                <td>@category.SubCategoryID
                </td>
                <td>@category.Controller
                </td>
                <td>@category.Action
                </td>
                <td>@category.IsAdmin
                </td>
                <td>@category.UserYN
                </td>
                <td>
                
                </td>
            </tr>
        }
    </tbody>
</table>
